<?php 
	include './header.php';
	//var_dump($_SESSION['car']);
?>
<div class="clear"></div>
<div id="main">
	<div class="goods">
		<div class="car">
		<table border="1" cellpadding="5" cellspacing="0" width="100%">
			<tr height="50">
				<th>序号</th>
				<th>商品名称</th>
				<th>图片</th>
				<th>单价</th>
				<th>数量</th>
				<th>小计</th>
				<th>操作</th>
			</tr>
			<?php if (empty($_SESSION['car'])) :?>
				<img src="" alt="">
			<?php else:?>
				<?php foreach ($_SESSION['car'] as $key => $value) :?>
					<tr align="center">
						<td><?php echo $value['gid'];?></td>
						<td><?php echo $value['gname'];?></td>
						<td><img src="<?php echo URL.'/public/uploads/'.substr($value['giname'], 0,4).'/'.substr($value['giname'], 4,2).'/'.substr($value['giname'], 6,2).'/50_'.$value['giname'];?>" alt="美工回家生娃了"/>
						</td>
						<td><font style="color:red;font:bold 18px/30px 宋体;">$:<?php echo $value['gp'];?></font></td>
						<td><?php echo $value['num'];?></td>
						<td><?php echo $value['num']*$value['gp'];?></td>
						<td><a style="color:red;"href="<?php echo URL;?>/docar.php?a=del&id=<?php echo $value['gid'];?>">删除</a></td>
					</tr>
				<?php endforeach;?>
			<?php endif;?>
		</table>
		</div>
		<div class="button">
			<a href="<?php echo URL;?>/docar.php?a=reset"><button>清空购物车</button></a>
			<a href="<?php echo URL;?>/index.php"><button>继续购物</button></a>
			<a href="<?php echo URL;?>/order.php"><button>提交订单</button></a>
		</div>
	</div>
</div>
<?php 
	include PATH.'/footer.php';
?>